/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.view;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

/**
 *
 * @author admin
 */
public class PanelTambahAnggota extends JPanel {
    private  JLabel labelKodeAnggota;
    private  JTextField textKodeAnggota;
    private JLabel labelNama;
    private JTextField textNama; 
    private JButton tombolSimpan;
    private JButton tombolBatal;
    
    public PanelTambahAnggota(){
        setLayout(new BorderLayout());

        labelKodeAnggota= new JLabel("id Anggota");
        labelKodeAnggota.setBounds(20, 130, 100, 20);
        add(labelKodeAnggota);

        textKodeAnggota= new JTextField(30);
        textKodeAnggota.setBounds(110, 130, 100, 20);
        add(textKodeAnggota);

        labelNama= new JLabel("Nama Anggota");
        labelNama.setBounds(18, 150, 120, 40);
        add(labelNama);

        textNama= new JTextField(20);
        textNama.setBounds(110, 160, 100, 20);
        add(textNama);

        tombolSimpan= new JButton("Simpan");
        tombolSimpan.setBounds(100, 300, 100, 30);
        add(tombolSimpan);
        tombolSimpan.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveCommand();
            }
        });

        tombolBatal= new JButton("Batal");
        tombolBatal.setBounds(240, 300, 100, 30);
        add(tombolBatal);
        tombolBatal.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                cancelCommand();
            }
        });

                this.setSize(500, 400);
        this.setVisible(true);
    }
    
    private void cancelCommand(){
        System.exit(0);
    }

    private void saveCommand(){
        JOptionPane.showMessageDialog(null,"Data Anggota Tersimpan");
        System.exit(0);
    }
}
